﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameView.Comment
{
    public class AsyncMessageHandler<TMessage>
    {
        private readonly Func<TMessage, Task> _handler;

        public AsyncMessageHandler(Func<TMessage, Task> handler)
        {
            _handler = handler;
        }

        public async Task Handle(TMessage message)
        {
            await _handler(message);
        }
    }
}
